﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.Practices.ServiceLocation;
using Mangosoft.DiceCopy.Presentation.Domain.Handlers;


namespace Mangosoft.DiceCopy.Presentation.MvcApp.Controllers {
    public class HomeController : AuthorizedController {

        public HomeController(IServiceLocator serviceLocator)
            : base(serviceLocator) {
        }

        public ActionResult Details(Guid id) {

            return View();
        }

        public ActionResult Browse() {
            return View();
        }

        public ActionResult Index() {
            var ads = Using<GetAdvertisings>().Execute(true);

            Using<CreateResume>().Execute(Guid.Parse("21E5BD08-8734-4440-8CB4-E5796DBC69A4"));

            return View(ads);
          
        }

        [ChildActionOnly]
        public ActionResult NewsPane() {
            var newsData = Using<GetNewsByChannel>()
                 .Execute(2).Take(50);

            return PartialView(newsData);
        }

        [ChildActionOnly]
        public ActionResult TopBoard() {

            return PartialView();
        }
    }
}
